<script language="javascript" type="text/javascript" src="__PUBLIC__/js/My97DatePicker/WdatePicker.js"></script>
<if condition="$isNew eq false">
<div style="text-align: center;font-size: 18px;margin: 10px;color: #2618EF;">【订单链接】<a href="{:U(MODULE_NAME.'/Order/saleDetail',array('id'=>$message['orderID']))}" target="_blank">{:U(MODULE_NAME.'/Order/saleDetail',array('id'=>$message['orderID']))}</a></div>
<else />
<div style="text-align: center;font-size: 18px;margin: 10px;color: #2618EF;">【订单链接】<a href="{:U(MODULE_NAME.'/Order/saleDetail',array('id'=>$order['id']))}" target="_blank">{:U(MODULE_NAME.'/Order/saleDetail',array('id'=>$order['id']))}</a></div>
</if>
<div>
    <div class="form">
      <foreach name="messageDetail" item="v" >
      <dl>
        <dt>{$v.sendName}：</dt>
        <dd>
        	<p style="margin: 0px;">{$v.content}</p>
        	<p style="color: red;margin: 2px 0px;">{$v.sendTime}</p>
        </dd>
      </dl>
      </foreach>
      <if condition="$canWrite eq true">
		<form method='post' id="form_do" name="form_do" action="{:U(MODULE_NAME. '/Message/orderProcessDeal',array('id'=>$message['id']))}">
      <dl>
        <dt>回复内容：</dt>
        <dd>
		<textarea name="content" style="width: 450px;height: 80px;"></textarea>
        </dd>
      </dl>
      <dl>
        <dt></dt>
        <dd>
			<input type="submit" class="button-blue" id="submit" value="发送">
        	<input type="button" onclick="goBack()" class="button-green" value="返回" />
        	<if condition="$canEnd eq true">
        	<input type="button" class="button-red" onclick="dealEnd({$message['id']})" value="完成">
        	</if>
        	<if condition="$canStop eq true">
        	<input type="button" class="button-red" onclick="dealStop({$message['id']})" value="挂起">
        	</if>
        </dd>
      </dl>
      </form>
      <else />
		<if condition="$isNew eq true">
		<form method='post' id="form_do" name="form_do" action="{:U(MODULE_NAME. '/Message/orderProcessDeal',array('orderID'=>$order['id']))}">
		  <dl>
	        <dt>标题：</dt>
	        <dd>
				<input type="text" readonly="readonly" name="title" value="{$order.title}" style="width: 300px;">
	        </dd>
	      </dl>
	      <dl>
	        <dt>发起内容：</dt>
	        <dd>
			<textarea name="content" style="width: 450px;height: 80px;"></textarea>
	        </dd>
	      </dl>
	      <dl>
	        <dt></dt>
	        <dd>
				<input type="submit" class="button-blue" id="submit" value="发送">
	        	<input type="button" onclick="goBack()" class="button-green" value="返回" />
	        </dd>
	      </dl>
	      </form>
		</if>
		<if condition="$isNew eq false">
      	<dl>
        	<dt></dt>
	        <dd>
	        	<input type="button" onclick="goBack()" class="button-green" value="返回" />
	        </dd>
        </dl>
        </if>
      </if>
    </div>
</div>
<script type="text/javascript">
function dealEnd(id)
{
	if(confirm("你是否完成该对话？") == true)
	{
	 	window.location.href = "{:U(MODULE_NAME. '/Message/orderProcessDealEnd',array('id'=>$message['id']))}";
	}
}
function dealStop(id)
{
	var Div = layer.open({
	    type: 1,
	    title: '对话挂起',
	    area: ['450px', '200px'],
	    shift: 0, 
	    content: '<div class="layer-content"><form method="post" id="layerDiv" name="form_do" action="/Home/Message/orderProcessDealStop.html"><p>你现在要挂起该订单对话</p><p>提醒时间：<input class="Wdate" type="text" style="width:120px;padding:2px 5px;" onclick="WdatePicker()" name="enddate" value=""><input type="hidden" name="id" value="'+id+'"></p></form></div>',
	    btn:['确定','取消'],
	    yes: function(index){
	    	$('#layerDiv').submit();
	    }, 
	    cancel: function(){
	    	layer.close(Div);
	    }
	});
}
</script>
